﻿using System.Xml;

namespace NJabber.Stream.Elements
{
    public abstract class CompositeElement : CompositeElement<XmppStreamElement>
    {
        public CompositeElement(string name) 
            : base(name)
        {
        }

        public CompositeElement(string name, string namespaceUri) 
            : base(name, namespaceUri)
        {
        }

        public CompositeElement(string name, string namespaceName, string namespaceUri)
            : base(name, namespaceName, namespaceUri)
        {
        }

        public CompositeElement(string name, params XmppStreamElement[] children)
            : base(name, children)
        {
        }

        protected override void WriteElements(XmlWriter writer)
        {
            foreach (XmppStreamElement element in Content) element.Write(writer);
        }
    }
}
